<template>
  <div class="home">
    <Header></Header>

    <div class="luffy-city">
      <!--    轮播图-->
      <div class="banner-content">
        <div class="bannerSwiper">
          <el-carousel height="400px">
            <el-carousel-item v-for="(value,index) in banner_list" :key="value.id">
              <a :href="value.link" style="display: inline-block;height: 400px;width:
100%">
                <img :src="value.image_url" alt/>
              </a>
            </el-carousel-item>
          </el-carousel>
        </div>
      </div>
      <!--      内容-->
      <div class="home-courses">
        <div class="title">
          <h1>自学编程必备免费+实战教程</h1>
          <p>这些课程是决定你能否成为编程奇才的关键教程 - 免费+实战，我们送给你了。</p>
        </div>
        <div class="content">
          <div class='more'>
            <a href="" class="line-center">更多实战<img
              src="//hcdn2.luffycity.com/media/frontend/index/home-right_1567483307.3430119.png" alt=""></a>
          </div>
          <div class="courses">
            <div class="table_top">
              <el-container>
                <el-header>Header</el-header>
                <el-main>Main</el-main>
              </el-container>

              <el-container>
                <el-header>Header</el-header>
                <el-main>Main</el-main>
                <el-footer>Footer</el-footer>
              </el-container>
            </div>
            <!--            <br>-->
            <!--            <br>-->
            <div class="table_middle">
              <el-container>
                <el-aside width="200px">Aside</el-aside>
                <el-main>Main</el-main>
              </el-container>
              <el-container>
                <el-header>Header</el-header>
                <el-container>
                  <el-aside width="200px">Aside</el-aside>
                  <el-main>Main</el-main>
                </el-container>
              </el-container>
              <el-container>
                <el-header>Header</el-header>
                <el-container>
                  <el-aside width="200px">Aside</el-aside>
                  <el-container>
                    <el-main>Main</el-main>
                    <el-footer>Footer</el-footer>
                  </el-container>
                </el-container>
              </el-container>
            </div>
            <!--            <br>-->
            <!--            <br>-->
            <div class="table_last">
              <el-container>
                <el-aside width="200px">Aside</el-aside>
                <el-container>
                  <el-header>Header</el-header>
                  <el-main>Main</el-main>
                </el-container>
              </el-container>

              <el-container>
                <el-aside width="200px">Aside</el-aside>
                <el-container>
                  <el-header>Header</el-header>
                  <el-main>Main</el-main>
                  <el-footer>Footer</el-footer>
                </el-container>
              </el-container>
            </div>

          </div>
        </div>
      </div>
    </div>

    <Footer></Footer>
  </div>

</template>

<script>
  import Header from "./common/Header";
  import Footer from "./common/Footer";
  import settings from "../../src/settings";

  export default {
    name: "Home",
    data() {
      return {
        banner_list: [],
        value: true
      }
    },
    methods: {
      get_banner_data() {
        // console.log(settings.Host)
        this.$axios.get(`${(settings.Host)}/home/banner/`,)
          .then((res) => {
            // console.log(res);
            this.banner_list = res.data
          })
          .catch((error) => {
            console.log(error);
          })
      }
    },
    created() {
      this.get_banner_data();
    },

    components: {
      Header,
      Footer,
    },
  }


</script>

<style scoped>


  .luffy-city .banner-content {
    margin-bottom: 58px;
  }

  .luffy-city {
    display: flex;
    flex-direction: column;
    flex: 1;
  }


  .luffy-city .title {
    width: 100%;
    text-align: center;
  }

  .luffy-city .title h1 {
    color: #333;
    font-size: 28px;
    font-weight: 400;
  }

  .luffy-city .title p {
    margin-top: 14px;
    font-size: 14px;
    font-weight: 300;
    color: #5e5e5e;
  }

  .bannerSwiper img {
    width: 100%;

    height: 100%;
    background-size: 100%;
    border: 0;
    overflow: hidden;
    vertical-align: middle;
  }


  .luffy-city .home-courses {
    width: 100%;
    height: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .luffy-city .home-courses .content {
    width: 1200px;
  }


  .luffy-city .home-courses .content .more {
    width: 100%;
    font-size: 14px;
    margin-top: 12px;
    padding-right: 20px;
    margin-bottom: 23px;
    display: flex;
    justify-content: flex-end;
  }

  .luffy-city .line-center {
    display: flex;
    align-items: center;
  }

  .luffy-city .home-courses .content .more a {
    color: #9d9d9d;
    text-decoration: none !important;
    outline: none;
    float: right;
  }

  .luffy-city .home-courses .content .more a img {
    width: 14px;
    height: 14px;
    margin-left: 5px;
  }

  .courses .el-container .el-header {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }

  .courses .el-container .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }

  .courses .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }

  .courses .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }

  body > .courses .el-container {
    margin-bottom: 40px;
  }

  .courses .el-container:nth-child(5) .el-aside,
  .courses .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .courses .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }

  .table_middle {
    margin-top: 55px;
  }

  .table_last {
    margin-top: 55px;
    margin-bottom: 100px;
  }
</style>
